const express = require('express')
const channeloperation = require('../controllers/channel') // 处理文章请求
// const validate = require('../validator/article') //配置文章校验
const tokenverify = require('../middleware/tokenverify') // token验证
const router = express.Router()

// 用户频道文章列表
router.get('/userchannels', channeloperation.artChannelsList)

// 所有频道列表
router.get(
  '/channels/all',
  channeloperation.ChannelsList
)

// 添加用户频道
router.patch(
  '/userchannels',
  tokenverify,
  channeloperation.addChannel
)

// 删除用户频道
router.delete(
  '/userchannels/:channel_id',
  tokenverify,
  channeloperation.delChannel
)

module.exports = router
